import request from '@/utils/api'

export const followUser = (followerId, followedId) => {
  return request.post('/follows', null, { params: { followerId, followedId } })
}

export const unfollowUser = (followerId, followedId) => {
  return request.delete('/follows', { params: { followerId, followedId } })
}

export const unfollowAllByFollower = (followerId) => {
  return request.delete(`/follows/follower/${followerId}`)
}

export const unfollowAllByFollowed = (followedId) => {
  return request.delete(`/follows/followed/${followedId}`)
}

export const isFollowing = (followerId, followedId) => {
  return request.get('/follows/status', { params: { followerId, followedId } })
}

export const getFollowingCount = (followerId) => {
  return request.get(`/follows/follower/${followerId}/count`)
}

export const getFollowersCount = (followedId) => {
  return request.get(`/follows/followed/${followedId}/count`)
}

export const getFollowingList = (followerId) => {
  return request.get(`/follows/follower/${followerId}`)
}

export const getFollowersList = (followedId) => {
  return request.get(`/follows/followed/${followedId}`)
}